package com.nowcoder;

import java.util.Scanner;

public class SentenceReverse {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextLine()) {
            String sentence = scanner.nextLine();
            System.out.println(solver(sentence));
        }
    }

    public static String solver(String sentence) {
        String[] strs = sentence.split(" ");
        StringBuilder builder = new StringBuilder(1000);
        for (int i = strs.length - 1; i >= 0; i--) {
            builder.append(" ").append(strs[i]);
        }
        return builder.substring(1);
    }
}
